package es.app.acciones;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import es.app.beans.Usuario;
import es.app.constantes.Constantes;

public class PlayerAction extends AppSHSAction{
	
	public ActionForward listarPlayers(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
//		PlayerForm formularioPlayers = (PlayerForm)form;
//		ServicePlayers servicioPlayers = (ServicePlayers)ContextLoader.getCurrentWebApplicationContext().getBean("servicePlayer");
//		
//		List<Player> lista = servicioPlayers.findAll();
//		request.setAttribute("listaPlayers", lista);
//		formularioPlayers.setLista(lista);
		setOpcionMenu(request, Constantes.MENU_PLAYERS);
		System.out.println("usuario: "+((Usuario)request.getSession(false).getAttribute("usuario")).getIdUsuario());
		return mapping.findForward("listar");
	}

}
